package com.jwcao.common.cast.operation.access;

import com.jwcao.common.scan.object.ScanField;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * name: AccessOperation description: TODO
 *
 * @author caojingwei date: 2023/3/23 16:11
 */
@Getter
public abstract class AccessOperation {

    protected final ScanField targetField;

    public AccessOperation(ScanField targetField) {
        this.targetField = targetField;
    }

    public abstract Object execute(Object sourceObject);

    public boolean isTarget(String name) {
        return StringUtils.equals(targetField.getName(), name);
    }
}
